<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>欢迎登录后台管理系统</title>
<link href="__STATIC__/Admin/css/base.css" rel="stylesheet" type="text/css" />
<link href="__STATIC__/Admin/css/right.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="__STATIC__/js/jquery-2.1.1.min.js"></script>
		<link href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
		<link rel="stylesheet" href="__STATIC__/Admin/css/bootstrap-switch.min.css" />
		<script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
 
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript" src="__STATIC__/Admin/js/bootstrap-switch.min.js" ></script>

</script>
</head>
<body>
<div class="place"> <span>位置：</span>
  <ul class="placeul">
    <li><a href="{:url('Index/center')}">首页</a></li>
    <li>系统维护</li>
  </ul>
</div>
<div class="formbody">
	{if($list['is_close']==0)}
  <input type="checkbox" name="my-checkbox" data-on-text="开" data-off-text="关" checked>
  <div id="tipss">已开启</div>
  	{else}
  <input type="checkbox" name="my-checkbox" data-on-text="开" data-off-text="关">
  <div id="tipss">已关闭</div>
  	{/if}
  
</div>
<script>
//检查输入框是否为空
  $(function () {
	  $("[name='my-checkbox']").bootstrapSwitch();
		$('input[name="my-checkbox"]').on('switchChange.bootstrapSwitch', function(event, state) {

	var v = 0;
	if(state){
		v=0;
	}else{
		v=1;
	}
$.post("{:url('game/ajaxsetting2')}",{states:v},function(data){
	if(data.data==1){
		$("#tipss").text("已关闭");
	}else{
		$("#tipss").text("已开启");
	}
});


});
  });
</script>
</body>
</html>